% sentence(Parse, [tu3, la5nh, sharp, sj16vsl, co1, ma2u, gi2], []).
% tủ_lạnh/máy_lạnh/tủ_đông sharp/samsung/lg xxx/yyy/zzz có (những) màu gì/nào?
% tu3_la5nh/ma1y_la5nh/tu3_d9o6ng sharp/samsung/lg xxx/yyy/zzz co1 (nhu74ng) ma2u gi2/na2o


sentence(s(NP,VP))-->np(NP),vp(VP).

% cum danh tu
np(np(N_sp, NE))-->n_sp(N_sp), ne(NE).

% cac loai san pham
n_sp(n_sp('tu3 la5nh'))-->[tu3, la5nh].
n_sp(n_sp('tu3 d9o6ng'))-->[tu3, d9o6ng].
n_sp(n_sp('tu3 ma1t'))-->[tu3, ma1t].
n_sp(n_sp('ma1y la5nh'))-->[ma1y, la5nh].
n_sp(n_sp('ma1y gia85t'))-->[ma1y, gia85t].
n_sp(n_sp('d9ie62u ho2a'))-->[d9ie62u, ho2a].

ne(ne(N_hsx, Pron_sp))-->n_hsx(N_hsx),!,pron_sp(Pron_sp).
ne(Pron_sp)-->pron_sp(Pron_sp).

% cac hang san xuat
n_hsx(n_hsx(panasonic))-->[panasonic].
n_hsx(n_hsx(daikin))-->[daikin].
n_hsx(n_hsx(lg))-->[lg].
n_hsx(n_hsx(samsung))-->[samsung].
n_hsx(n_hsx(mitsubishi))-->[mitsubishi].
n_hsx(n_hsx(electrolux))-->[electrolux].
n_hsx(n_hsx(sharp))-->[sharp].
n_hsx(n_hsx(sanyo))-->[sanyo].
n_hsx(n_hsx(hitachi))-->[hitachi].
n_hsx(n_hsx(gree))-->[gree].

pron_sp(pron_sp(H))-->[H].

% cum dong tu
vp(vp(V, QP, NP))-->v(V),qp(QP),np1(NP).

% dong tu
v(v(co1))-->[co1].

% so luong
qp(qp(nhu74ng))-->[nhu74ng];[].

% tu hoi
np1(np1(N_tuhoi,R))-->n_tuhoi(N_tuhoi),r(R).
np1(N_tuhoi)-->n_tuhoi(N_tuhoi).

% cac tu hoi
n_tuhoi(n_tuhoi('ma2u'))-->[ma2u].

r(r(W_gi))-->w_gi(W_gi).
r(r(W_nao))-->w_nao(W_nao).

w_gi(gi2)-->[gi2].
w_nao(na2o)-->[na2o].